// token
const hmtt = 'HMTT_TOKEN'
export const setToken = token => localStorage.setItem(hmtt, token)
export const getToken = () => localStorage.getItem(hmtt)
export const removeToken = () => localStorage.removeItem(hmtt)

// category
export const setCategory = data => localStorage.setItem('category', JSON.stringify(data))
export const getCategory = () => JSON.parse(localStorage.getItem('category'))
export const removeCategory = () => localStorage.removeItem('category')

// userID
export const setUserId = id => localStorage.setItem('userId', id)
export const getUserId = () => localStorage.getItem('userId')
export const removeUserId = () => localStorage.removeItem('userId')

// 历史搜索记录
export const setSearchHistory = data => localStorage.setItem('searchHistory', JSON.stringify(data))
export const getSearchHistory = () => JSON.parse(localStorage.getItem('searchHistory'))
export const removeSearchHistory = () => localStorage.removeItem('searchHistory')
